import Vue from 'vue'
import Vuex from 'vuex'
// cnpm i vuex-persistedstate -S
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    login:false,
    musicData:{ //播放列表{
      coverImgUrl : ''
    },
    listsname:{},
    shoucan:'',
    playlista:[]
  },
  mutations: {
    setLogin(state){
      state.login = true;
    },
    musicDatafun(state,obj){
      state.musicData = obj;
    },
    listsname(state,obj){
      state.listsname = obj;
    },
    playdata(state,obj){
      state.shoucan = obj;
    },
    palyddd(state,obj){
      state.playlista = obj;
      console.log(obj);
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [createPersistedState({
    storage:window.sessionStorage
  })]
})
